Jx.declare('Jx.data.xml.css.Query', {

	$extend: 'lang.css.selector.compiler',

	caselessType: false,

	/* use tagName in uppercase */
	'__code_Match_Type': function( operation, nodeVar, typeVar, match){

		if (this.caselessType){

			typeVar+='.toUpperCase()';

			match = match.toUpperCase();

		}

		return typeVar + ' == "' + this.__Str.escape(match) + '"';

	},

	/* take advantage of getElements by tag name */
	getNodesFrom: function( compiled, subject, session ){

		var infos = compiled.nodeInfoIndex,

			types = 'type' in infos ?

				infos.type

				:

				[];

		if (types.length == 1){

			console.log( types[ 0 ] );

		}

		return types.length == 1 ?

				subject.getElementsByTagName(session.default_type = types[ 0 ])

				:

				subject.getElementsByTagName('*');

	}

});
